﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace ServoDrivesLib.Model
{
    [StructLayout(LayoutKind.Explicit, Pack = 2, Size = 4)]
    public struct Union
    {
        [FieldOffset(0)] public byte B1;
        [FieldOffset(1)] public byte B2;
        [FieldOffset(2)] public byte B3;
        [FieldOffset(3)] public byte B4;
        [FieldOffset(0)] public Int16 I16_1;
        [FieldOffset(2)] public Int16 I16_2;
        [FieldOffset(0)] public Int32 I32;
        [FieldOffset(0)] public float F32;
        [FieldOffset(0)] public UInt32 U32;
    }
}
